package cn.yunhe.video.Service.impl;

import cn.yunhe.video.Service.IVideoService;
import cn.yunhe.video.dao.IVideoDao;
import cn.yunhe.video.entity.Video;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class VideoServiceImpl extends ServiceImpl<IVideoDao, Video> implements IVideoService {
    @Autowired
    private IVideoDao videoDao;

    /**
     * 骆超凡 邓永凯
     * @param id
     * @return
     */
    @Override
    public Video query(int id) {
        return videoDao.query(id);
    }

    /**
     * 骆超凡 邓永凯
     * @param id
     * @return
     */
    @Override
    public boolean delLike(int id) {
        int num = videoDao.delLike(id);
        if(num>0){
            return true;
        }else{
            return false;
        }
    }

    /**
     * 骆超凡 邓永凯
     * @param id
     * @return
     */
    @Override
    public boolean addLike(int id) {
        int num = videoDao.addLike(id);
        if(num>0){
            return true;
        }else{
            return false;
        }
    }
}
